<template>
<div id="charts7" style="height: 400px;" ref="charts7"></div>
</template>
<script>
  export default {
    mounted() {
      this.drawchart()
    },
    methods: {

      drawchart() {
        var option = {
          title: {
            text: ''
          },
          tooltip: {},
          animationDurationUpdate: 1500,
          animationEasingUpdate: 'quinticInOut',
          label: {
            normal: {
              show: true,
              textStyle: {
                fontSize: 12
              },
            }
          },
          legend: {
            x: "center",
            show: false,
            data: ["中文论文共著", "英文论文共著", '其他共著']
          },
          series: [

            {
              type: 'graph',
              layout: 'force',
              symbolSize: 40,
              focusNodeAdjacency: true,
              /*roam: true,*/
              categories: [{
                name: '中文论文共著',
                itemStyle: {
                  normal: {
                    color: "#009800",
                  }
                }
              }, {
                name: '英文论文共著',
                itemStyle: {
                  normal: {
                    color: "#4592FF",
                  }
                }
              }, {
                name: '其他共著',
                itemStyle: {
                  normal: {
                    color: "#3592F",
                  }
                }
              }],
              label: {
                normal: {
                  show: true,
                  textStyle: {
                    fontSize: 12
                  },
                }
              },
              force: {
                repulsion: 500,

              },
              edgeSymbolSize: [4, 40],
              edgeLabel: {
                normal: {
                  show: true,
                  textStyle: {
                    fontSize: 8
                  },
                  formatter: "{c}"
                }
              },
              data: [{
                name: '彭永德',
                draggable: true,
              }, {
                name: '冯可梁',
                category: 1,
                draggable: true,
              }, {
                name: '邓志荣',
                category: 1,
                draggable: true,
              }, {
                name: '李荣庆',
                category: 1,
                draggable: true,
              }, {
                name: '郑志勇',
                category: 1,
                draggable: true,
              }, {
                name: '赵英杰',
                category: 1,
                draggable: true,
              }, {
                name: '王承军',
                category: 1,
                draggable: true,
              }, {
                name: '陈卫东',
                category: 1,
                draggable: true,
              }, {
                name: '陈现忠',
                category: 1,
                draggable: true,
              },],
              links: [{
                source: 0,
                target: 1,
                category: 0,
                value: '中文论文共著'
              }, {
                source: 0,
                target: 2,
                value: '英文论文共著'
              }, {
                source: 0,
                target: 3,
                value: '中文论文共著'
              }, {
                source: 0,
                target: 4,
                value: '中文论文共著'
              }, {
                source: 1,
                target: 2,
                value: '中文论文共著'
              }, {
                source: 0,
                target: 5,
                value: '中文论文共著'
              }, {
                source: 4,
                target: 5,
                value: '中文论文共著'
              }, {
                source: 2,
                target: 8,
                value: '中文论文共著'
              }, {
                source: 0,
                target: 12,
                value: '中文论文共著'
              }, {
                source: 6,
                target: 11,
                value: '中文论文共著'
              }, {
                source: 6,
                target: 3,
                value: '中文论文共著'
              }, {
                source: 7,
                target: 5,
                value: '中文论文共著'
              }, {
                source: 9,
                target: 10,
                value: '中文论文共著'
              }, {
                source: 3,
                target: 10,
                value: '中文论文共著'
              }, {
                source: 2,
                target: 11,
                value: '中文论文共著'
              }],
              lineStyle: {
                normal: {
                  opacity: 0.9,
                  width: 1,
                  curveness: 0,
                  color:'#000'
                }
              }
            }
          ]
        };
        var mychart = this.$echarts.init(this.$refs.charts7)
        mychart.setOption(option)
      }
    }
  }
</script>
<style></style>
